End-User Interaction with the Toolbar and Menus
- When a tool is selected the ToolbarSelect event raises to tell the application which tool was selected.
- When a tool is used, ToolUse events raise to notify the application when: the tool is clicked, the tool is in action and the tool is no longer in use.
- When the toolbar window opens, the ToolbarOpen event raises.
- When the toolbar window closes, the ToolbarClose event raises.
- When a menu item is selected, a MenuSelect raises to notify the application of the selection made. The menu ID is provided to the event handler when this event is raised.
VB Example | Copy Code |
---|---|
// Write the event handler to dispatch the work when the user makes a menu selection Sub IX1_MenuSelect (long menuType, long tool, long topMenuID, long subMenuID, long user1, long user2) if (menuType = MenuContext) then Select Case topMenuID Case 100 ' Color MyObj.Color = user1 Case 200 ' Size MyObj.Size = user1 Case 300 ' Type SelectCase subMenuID Case 310 MyObj.DrawLine Case 320 MyObj.DrawEllipse Case 330 MyObj.DrawRect End Select end if end sub |
End-User Scrolling
The application end-user can change the portion of the image that is viewed in the View Window using scrollbars.
If scrollbars are enabled, then when the scroll bar is clicked, a Scroll event raises to alert the application to a scrolling request. The ScrollBarLargeChangeH, ScrollBarLargeChangeV, ScrollBarSmallChangeH and ScrollBarSmallChangeV properties are set to indicate the amount of requested change to the horizontal and vertical positioning of the view. The view is updated on the next paint.
End-User Cursor Movement
Track the position of the cursor in the displayed image as follows:
-
The PixelColor read-only property returns the color of the pixel at the current cursor position.
To translate between the coordinates on the displayed image and the coordinates in the DIB, use TranslateX and TranslateY methods. |
End-User Mouse and Key Actions
-
When an application end-user uses the mouse, mouse events (Click, DblClick, MouseUp, MouseDown, MouseMove, OLEDragDrop, and OLEDragOver) are raised if they have been enabled (EventSetEnabled, EventGetEnabled).
-
An an application end-user presses keys, key events (KeyDown, KeyPress, KeyUp) are raised if keys have been enabled (KeysGetEnabled, KeysSetEnabled), and if key events have been enabled (EventSetEnabled, EventGetEnabled).